﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Microsoft.Practices.Unity;
using Infrastructure.Aspect.Authorization;

namespace Infrastructure.WebMvc.MvcAttributes
{
    [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
    public class RuleAuthorizeAttribute : AuthorizeAttribute
    {
        private IAuthorizationService _AuthorizationService;

        [Dependency]
        public IAuthorizationService AuthorizationService {
            get { return this._AuthorizationService; }
            set { 
                this._AuthorizationService = value;   
            }
        }


        public override void OnAuthorization(AuthorizationContext filterContext)
        {            
            var str = filterContext.ActionDescriptor.ControllerDescriptor.ControllerType.FullName + "." + filterContext.ActionDescriptor.ActionName;
            base.OnAuthorization(filterContext);
        }
        
    }
}
